FINALS

Stuff to cover for finals:

Can auto be used?

    #include <iostream>   // cout, endl
    #include <iomanip>    // setw
    #include <vector>     // vector
    #include <string>     // string
    #include <fstream>    // ifstream
    #include <sstream>    // stringstream
    #include <algorithm>  // for_each
    #include <list> // Linked list (doubly by default)

SMALL SHIT TO REMEMBER:

friend before ostream. ostream is a friend!

friend std::ostream operator<<(std::ostream & o, const Foo & foo);


operator< is much loved. Its brother, operator> is a hated man.


Remember to check if something is *this before doing most member functions/operator overloads


REMEMBER TO GODDAMN PUT A SEMICOLON AFTER CLASS DEFINITIONS
DON'T BE AN IDIOT BRANDON


value_type
size_type


When modifying what() in a derived exception class, do this:

  sprintf(buff, "Subscript error at index: %d", subscript_);

FOR LAMBDA EXPRESSIONS:

T2 copy_if(T1 begin1, T1 end1, T2 begin2, UnaryPredicate const &func)

or

T2 copy_if(T1 begin1, T1 end1, T2 begin2, UnaryPredicate func)

ifstream only has >> overloaded, ofstream only has << overloaded


For file input, to check input

  if (std::getline(infile, str).eof()) break;